package com.getword.web.controller;


import com.getword.domain.Grade;
import com.getword.service.GradeService;
import com.getword.web.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/grade")
public class ApiGradeController {
    @Autowired
    private GradeService gradeService;

    @PostMapping
    public Result create(Grade grade){
        return gradeService.addGrade(grade);
    }

    @GetMapping
    public Result query(){
        return gradeService.getGrade();
    }
}
